{{define "header"}}
<link rel="stylesheet" href="buildlog.css">
<script type="text/javascript" src="script_bundle.min.js"></script>
{{end}}
{{define "body"}}
<div>
{{range $log := .LogViews}}
  <div>
    {{if .CanAnalyze}}<button class="analyze-button" data-artifact="{{$log.ArtifactName}}" title="Highlight interesting lines identified by prow">Analyze</button>{{end}}
    <button class="show-all-button" data-artifact="{{$log.ArtifactName}}">Show all hidden lines</button>
    {{if .ShowRawLog}}<a href="{{$log.ArtifactLink}}" style="padding-left:15px;">Raw {{$log.ArtifactName}}<i class="material-icons" style="padding-left: 3px;">open_in_new</i></a>{{end}}
    <div class="loglines{{if .CanSave}} savable{{end}}" id="{{$log.ArtifactName}}-content">
      {{block "line groups" $log.LineGroups}}
      {{range . }}
        {{if .Skip}}
          {{block "skipped group" . }}
          <div class="show-skipped" data-artifact="{{.ArtifactName}}" data-offset="{{.ByteOffset}}" data-length="{{.ByteLength}}" data-start-line="{{.Start}}" data-end-line="{{.End}}">
            {{if .Expand }}
            <div>
              <div class="linenum"><button title="Expand down" class="top"><i class="material-icons">expand_more</i></button></div>
              <div class="linetext"></div>
            </div>
            {{end}}
            <div>
              <div class="linenum"><button title="Show all"><i class="material-icons">{{if .Expand}}more_vert{{else}}unfold_more{{end}}</i></button></div>
              <div class="linetext"><button>{{.LinesSkipped}} skipped lines...</button></div>
            </div>
            {{if .Expand }}
            <div>
              <div class="linenum"><button title="Expand up" class="bottom"><i class="material-icons">expand_less</i></button></div>
              <div class="linetext"></div>
            </div>
            {{end}}
          </div>
          {{end}}
        {{else}}
          {{block "shown group" . }}
            <div class="shown">
            {{range .LogLines}}
            <div id="{{.ArtifactName}}:{{.Number}}"{{if .Focused}}class="focus-line"{{end}}>
              {{if .Clip}}
                <button class="focus-clip" id="focus-clip"><i class="material-icons">attachment</i></button>
              {{end}}
              <div class="linenum"><a href="#{{.ArtifactName}}:{{.Number}}" data-artifact="{{.ArtifactName}}" data-line-number="{{.Number}}">{{.Number}}</a></div>
              <div class="linetext">
                <span {{if .Highlighted}}class="line-highlighted"{{end}}>
                  {{- range .SubLines -}}<span {{if .Highlighted}}class="match-highlighted"{{end}}>{{.Text}}</span>{{- end -}}
                </span>
              </div>
            </div>
            {{end}}
            </div>
          {{end}}
        {{end}}
      {{end}}
      {{end}}
    </div>
  </div>
{{end}}
</div>
{{end}}
